/*
 * @Author: linzaifei 1609781601@qq.com
 * @Date: 2025-05-19 08:35:17
 * @LastEditors: linzaifei 1609781601@qq.com
 * @LastEditTime: 2025-06-05 14:24:46
 * @FilePath: /vue3-cesium-plus/src/utils/cesium-drawing-config.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import * as Cesium from "cesium";

export const mainFabOpts = {
  direction: "left",
  modelValue: false,
};
export const fabActionOpts = {
  direction: "right",
  modelValue: false,
};
export const pinDrawingOpts = {
  billboardOpts: {
    image: "https://zouyaoji.top/vue-cesium/images/grepin.png",
    scale: 0.5,
    onClick(e: any) {
      console.log(e);
    },
  },
  labelOpts: {
    text: "图标点",
    font: "10px sans-serif",
    fillColor: "#ffffff",
    outlineColor: "#000000",
    outlineWidth: 2,
    pixelOffset: [0, -40],
    showBackground: false,
    onClick(e: any) {
      console.log(e);
    },
  },
};

export const polylineActionOpts = {
  polyline: {
    material: new Cesium.ColorMaterialProperty(Cesium.Color.RED.withAlpha(0.8)), // 红色半透明
    width: 3 // 线宽
  }
}

/*
  ...color,
  ...disableDepthTestDistance,
  ...distanceDisplayCondition,
  ...id,
  ...outlineColor,
  ...outlineWidth,
  ...pixelSize,
  ...position,
  ...scaleByDistance,
  ...show,
  ...translucencyByDistance,
  ...enableMouseEvent
*/
///点的配置
export const pointDrawingOpts = {
  pointOpts: {
    color: "#455BCA",
    outlineWidth: 2,
    outlineColor: "white",
    pixelSize: 14,
    scaleByDistance: {
      near: 1000,
      nearValue: 1,
      far: 10000,
      farValue: 0.5,
    },
    translucencyByDistance: {
      near: 1000,
      nearValue: 1,
      far: 10000,
      farValue: 0,
    },
    onClick(e: any) {
      console.log(e);
    },
  },
};

export const polygonDrawingOpts = {
  pointOpts: {
    color: "#455BCA",
    outlineWidth: 2,
    pixelSize: 14,
    outlineColor: "#ffffff",
    clampToGround: false,
    scaleByDistance: {
      near: 1000,
      nearValue: 1,
      far: 10000,
      farValue: 0.5,
    },
  },
};
export const regularDrawingOpts = {
  pointOpts: {
    color: "#455BCA",
    outlineWidth: 2,
    pixelSize: 14,
    outlineColor: "#ffffff",
    clampToGround: false,
    scaleByDistance: {
      near: 1000,
      nearValue: 1,
      far: 10000,
      farValue: 0.5,
    },
  },
  onClick(e: any) {
    console.log(e);
  },
};

export const polylineDrawingOpts = {
  pointOpts: {
    color: "#455BCA",
    outlineWidth: 2,
    pixelSize: 14,
    outlineColor: "#ffffff",
    clampToGround: false,
    scaleByDistance: {
      near: 1000,
      nearValue: 1,
      far: 10000,
      farValue: 0.5,
    },
  },
  labelOpts: {},
  polylineOpts: {
    width: 2,
    material: new Cesium.ColorMaterialProperty(Cesium.Color.RED),
    // arcType: 1, ///连接角度
    // clampToGround: false,
  },
  dashLineOpts: {
    
  },

  // loop: true,
  onClick(e: any) {
    console.log(e);
  },
};
